#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

int main()
{
	char a,b,c;
	char max, min, mid;
	while (scanf("%c%c%c", &a, &b, &c) != EOF)
	{
		max = a;
		if (max < b)
		{
			max = b;
			min = a;
			if (max < c)
			{
				max = c;
				mid = b;
				min = a;
			}
			else
			{
				if (c < min)
				{
					min = c;
					mid = a;
				}
				else
				{
					mid = c;
				}
			}
		}

		else
		{
			max = a;
			min = b;
			if (max < c)
			{
				max = c;
				mid = a;
			}
			else
			{
				if (b > c)
				{
					mid = b;
					min = c;
				}
				else
				{
					mid = c;
				}
			}
		}
		printf("%c %c %c\n", min, mid, max);
		getchar();
	}

	return 0;
}